<?php 
class authActions extends sfActions
{
	public function executeLogin(sfWebRequest $request){
		$this->form = new LoginForm();
		
		if($request->isMethod('post')){
			$this->form->bind($request->getParameter('login'));
			if($this->form->isValid()){
				$this->getUser()->setAuthenticated(true);
				$this->getUser()->addCredential('user');
				$this->redirect('@gas');
			}
		}
	}
	
	public function executeLogout(sfWebRequest $request){
		$this->getUser()->clearCredentials();
		$this->getUser()->setAuthenticated(false);
		$this->redirect('@login');
	}
	
	
}